home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Utilities / Interfaces / EditrSet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.6 KB  |  117 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        EditrSet.h
  3.  
  4.     Contains:    Class definition for EditerSet and ODEditerSetIterator
  5.  
  6.     Owned by:    Eric House 
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     
  11. */
  12.  
  13. #ifndef _EDITRSET_
  14. #define _EDITRSET_
  15.  
  16. #ifndef _PLFMDEF_
  17. #include "PlfmDef.h"
  18. #endif
  19.  
  20. #ifndef _ODOBJ_
  21. #include "ODObject.xh"
  22. #endif
  23.  
  24. #ifndef _ODTYPES_
  25. #include "ODTypes.h"
  26. #endif
  27.  
  28.  
  29. //=====================================================================================
  30. // Classes used by this interface
  31. //=====================================================================================
  32.  
  33. class EditorSetIterator ;
  34. class OrderedCollection;
  35. class OrderedCollectionIterator;
  36.  
  37. //=====================================================================================
  38. // Class EditorSet
  39. //=====================================================================================
  40.  
  41. class EditorSet
  42. {
  43.     
  44. public:
  45.  
  46.     EditorSet();
  47.     void InitEditorSet();
  48.     virtual ~EditorSet();
  49.  
  50.     ODMethod void AddEditor(ODEditor editor);
  51.     
  52.         // Adds an type to the end of the set, creating a copy of the argument in the set.
  53.  
  54.     ODMethod void AddEditorSet(EditorSet* editors);
  55.     
  56.         // Unions the two into this (leaving the argument unchanged).
  57.  
  58.     ODMethod void RemoveEditor(ODEditor editor);
  59.     
  60.         // Removes an editor from a set.  Does nothing if the argument editor is not present.
  61.     
  62.     ODMethod void RemoveEditor( EditorSet* editors );
  63.     
  64.         // Removes all editors present in the argument set.
  65.  
  66.     ODMethod void RemoveAllEditors();
  67.     
  68.         // Removes all editors from the set.
  69.  
  70.     ODMethod ODBoolean ContainsEditor(ODEditor editor);
  71.     
  72.         // Returns true if the set contains the specified editor.
  73.         // Otherwise, returns false.
  74.  
  75.     ODMethod ODULong GetEditorCount();
  76.         
  77.     ODMethod EditorSetIterator* CreateIterator();
  78.     
  79.         // Returns an iterator for the set, which can be used to retrieve editors
  80.         // from the set in order.
  81.  
  82. private:
  83.  
  84.     OrderedCollection*    fSet;
  85.  
  86.     Environment*    fEv;
  87.  
  88.     friend class EditorSetIterator;
  89. };
  90.     
  91. //=====================================================================================
  92. // Class EditorSetIterator
  93. //=====================================================================================
  94.  
  95. class EditorSetIterator
  96. {
  97.     
  98.  
  99.     public:
  100.         EditorSetIterator(EditorSet* set);
  101.         virtual ~EditorSetIterator();
  102.  
  103.         ODVMethod ODEditor    First();
  104.         ODVMethod ODEditor    Next();
  105.         ODVMethod ODBoolean    IsNotComplete();
  106.         
  107.             // These methods return a pointer to a string within the set.
  108.             // The client must not dispose this memory, and must be aware that
  109.             // These methods return nil if the requested item does not exist.
  110.         
  111.     private:
  112.         OrderedCollectionIterator*    fIterator;
  113. };
  114.  
  115.  
  116. #endif
  117.